package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.DramaMapper;
import com.jsb.model.Drama;
import com.jsb.model.DramaExample;

@Service
public class DramaService{
	
	@Resource
	private DramaMapper dramaMapper;
	
	public void addDrama(Drama drama) {
		dramaMapper.insertSelective(drama);
	}
	
	public void delDramaByUuid(String uuid) {
		dramaMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateDrama(Drama drama) {
		dramaMapper.updateByPrimaryKeySelective(drama);
	}
	
	public void updateDramaByExample(Drama drama,DramaExample dramaExample){
	    dramaMapper.updateByExampleSelective(drama,dramaExample);
	}
	
	public Drama getDramaByUuid(String uuid) {
		return dramaMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Drama> getPageDrama(DramaExample dramaExample) {
		return dramaMapper.selectPage(dramaExample);
	}
	
	public int countDrama(DramaExample dramaExample) {
		return dramaMapper.countByExample(dramaExample);
	}
	
	public List<Drama> selectByExample(DramaExample example){
	    return dramaMapper.selectByExample(example);
	}
}
